﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.OleDb;
namespace DM.IO
{
    public class OledbLoader : ILoader
    {
        public DataTable ToTable(string oledbConnectionString, string sql)
        {
            DataTable result = new DataTable();
            OleDbConnection cn = new OleDbConnection(oledbConnectionString);
            OleDbDataAdapter da = new OleDbDataAdapter(sql, cn);
            DataSet ds = new DataSet();
            da.Fill(ds, "LoadTable");
            result = ds.Tables["LoadTable"];
            return result;
        }
    }
}
